pub fn add(left: usize, right: usize) -> usize {
    left + right
}


pub trait HelloMacro {
    fn hello_macro();
}

#[cfg(test)]
mod tests {
    use super::*;
    use std::fmt;

    #[test]
    fn it_works() {
        let result = add(2, 2);
        assert_eq!(result, 4);
    }

    #[test]
    fn test_private_function() {
        let path = env!("path");
        println!("{}", path);
    }

    #[test]
    fn test_macro_file() {
        // 当前模块
        println!("current module is {}", module_path!());
        // 当前文件
        println!("current file is {}", file!());
        // 当前行数
        println!("current line is {}", line!());
        // 当前列数
        println!("current file issde {}", column!());
    }

    #[test]
    fn test_macro_format() {
        format!("test");
        println!("{}", format!("test"));
        format!("hello {}", "world!");
        println!("{}", format!("hello {}", "world!"));
        format!("x = {}, y = {y}", 10, y = 30);
        let (x, y) = (1, 2);
        format!("{x} + {y} = 3");

        let s = fmt::format(format_args!("hello {}", "world"));
        assert_eq!(s, format!("hello {}", "world"));
    }

    #[test]
    fn test_macro_format_nl() {
        use std::fmt;
    }
}
